//
//  AppDelegate+Configura.swift
//  SLQuickReader
//
//  Created by ALin on 2017/8/2.
//  Copyright © 2017年 ALin. All rights reserved.
//

import UIKit

extension AppDelegate
{
    func config() {
        configRootViewController()
        configNavgationBar()
    }
    
    func configNavgationBar() {
        let navigationBar = UINavigationBar.appearance()
        navigationBar.tintColor = UIColor.black
        navigationBar.titleTextAttributes = [NSFontAttributeName : UIFont.systemFont(ofSize: 15), NSForegroundColorAttributeName : UIColor.black]
        navigationBar.backgroundColor = UIColor.white

    }
    
    func configRootViewController() {
        window = UIWindow(frame: UIScreen.main.bounds)
        
        window?.rootViewController = MainTabViewController()
        
        window?.makeKeyAndVisible()
    }
}

extension UIView
{
    func masksToBounds(_ cornerRadius: CGFloat) {
        layer.cornerRadius = cornerRadius
        layer.masksToBounds = true
    }
    
    func setBorder(width: CGFloat, color: UIColor) {
        layer.borderColor = color.cgColor
        layer.borderWidth = width
    }
}
